import cors from "cors";

const corsOptions = {
  origin: "*", // 允许所有域名访问（生产环境建议替换为具体域名）
  methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
  preflightContinue: false,
  optionsSuccessStatus: 204,
};

export const corsMiddleware = cors(corsOptions);